﻿'Params
'type[1|2] (Required x 2) : 'user' | 'artists'
'value[1|2] (Required x 2) : [Last.fm username] | [Comma-separated artist names (max. 100)]
'limit (Optional, default = 5) : How many shared artists to display
'api_key (Required) : A Last.fm API key.
'Auth
'This service does not require authentication. 

Public Structure TasteometerCompareResponse
	Dim score As String
End Structure

Public Class TasteometerCompare
	Inherits BaseRequest
	Dim type1 As String = ""
	Dim value1 As String = ""
	Dim type2 As String = ""
	Dim value2 As String = ""
	Dim limit As String

	Public xmlresponse As XDocument = Nothing

	Public Sub New(type1 As String, value1 As String, type2 As String, value2 As String, limit As String)
		Me.type1 = type1
		Me.value1 = value1
		Me.type2 = type2
		Me.value2 = value2
		Me.limit = limit
	End Sub

	Public Sub sendRequest()
		InitializeMembers("tasteometer.compare")

		AddMember("type1", type1, True)
		AddMember("value1", value1, True)
		AddMember("type2", type2, True)
		AddMember("value2", value2, True)
		AddMember("limit", limit, False)
		AddMember("api_key", My.Settings.api_key, True)

		xmlresponse = sendPOSTResponse()
	End Sub

	Public Function getResponse() As TasteometerCompareResponse
		Dim response As New TasteometerCompareResponse
		response.score = "0"
		Try
			response.score = xmlresponse.<lfm>.<comparison>.<result>.<score>.Value
		Catch ex As Exception

		End Try

		Return response
	End Function
End Class
